package biz

import (
	"context"
	v1 "gitlab.cqcb.com/shangyou_mic/dscm-approve-api-pb/api/roses/v1"
)

type CommonRepo interface {
	LoadSystemConfig(ctx context.Context, req *v1.LoadSystemConfigRequest) (*v1.LoadSystemConfigReply, error)
	SaveSystemConfig(ctx context.Context, req *v1.SaveSystemConfigRequest) (*v1.SaveSystemConfigReply, error)

	SystemConfigLists(ctx context.Context, req *v1.SystemConfigListsRequest) (*v1.SystemConfigListsReply, error)
	SystemConfigUpdate(ctx context.Context, req *v1.SystemConfigUpdateRequest) (*v1.SystemConfigUpdateReply, error)

	TopicLists(ctx context.Context, req *v1.TopicListsRequest) (*v1.TopicListsReply, error)
	WechatLoginUserinfo(ctx context.Context, req *v1.WechatLoginUserinfoRequest) (*v1.WechatLoginUserinfoReply, error)
}

type Common struct {
	common CommonRepo
}

func NewCommon(common CommonRepo) (*Common, error) {
	return &Common{
		common: common,
	}, nil
}

func (s *Common) LoadSystemConfig(ctx context.Context, req *v1.LoadSystemConfigRequest) (*v1.LoadSystemConfigReply, error) {
	return s.common.LoadSystemConfig(ctx, req)
}

func (s *Common) SaveSystemConfig(ctx context.Context, req *v1.SaveSystemConfigRequest) (*v1.SaveSystemConfigReply, error) {
	return s.common.SaveSystemConfig(ctx, req)
}

func (s *Common) SystemConfigLists(ctx context.Context, req *v1.SystemConfigListsRequest) (*v1.SystemConfigListsReply, error) {
	return s.common.SystemConfigLists(ctx, req)
}

func (s *Common) SystemConfigUpdate(ctx context.Context, req *v1.SystemConfigUpdateRequest) (*v1.SystemConfigUpdateReply, error) {
	return s.common.SystemConfigUpdate(ctx, req)
}

func (s *Common) TopicLists(ctx context.Context, req *v1.TopicListsRequest) (*v1.TopicListsReply, error) {
	return s.common.TopicLists(ctx, req)
}

func (s *Common) WechatLoginUserinfo(ctx context.Context, req *v1.WechatLoginUserinfoRequest) (*v1.WechatLoginUserinfoReply, error) {
	return s.common.WechatLoginUserinfo(ctx, req)
}
